unit dmda_InOutType;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dmModule, FR_DSet, FR_DBSet, DB, ADODB;

type
  Tdtmda_InOutType = class(TdtmModule)
    adsMasterRemark: TStringField;
    adsMasterHasStop: TBooleanField;
    adsMasterStoper: TStringField;
    adsMasterStopDate: TDateTimeField;
    adsMasterStopMemo: TStringField;
    adsMasterHasUse: TBooleanField;
    adsMasterHasSysdefine: TBooleanField;
    adsMasterHasDefault: TBooleanField;
    adsMasterHasCheck: TBooleanField;
    adsMasterChecker: TStringField;
    adsMasterCheckTime: TDateTimeField;
    adsMasterWriter: TStringField;
    adsMasterWriteTime: TDateTimeField;
    adsMasterModifier: TStringField;
    adsMasterModifyTime: TDateTimeField;
    adsMasterID: TStringField;
    adsMastertype: TWordField;
    adsMastercode: TStringField;
    adsMastername: TStringField;
    adsMasterStockID: TStringField;
    adsMasterConArea: TStringField;
    res_Stock: TADODataSet;
    res_ConArea: TADODataSet;
    adsStockTree: TADODataSet;
    adsMasterBillType: TStringField;
    res_BillType: TADODataSet;
    adsMasterEditID: TStringField;
    adsMasterEdittype: TWordField;
    adsMasterEditcode: TStringField;
    adsMasterEditname: TStringField;
    adsMasterEditStockID: TStringField;
    adsMasterEditConArea: TStringField;
    adsMasterEditBillType: TStringField;
    adsMasterEditHasUse: TBooleanField;
    adsMasterEditHasSysdefine: TBooleanField;
    adsMasterEditHasDefault: TBooleanField;
    adsMasterEditHasStop: TBooleanField;
    adsMasterEditStoper: TStringField;
    adsMasterEditStopDate: TDateTimeField;
    adsMasterEditStopMemo: TStringField;
    adsMasterEditHasCheck: TBooleanField;
    adsMasterEditChecker: TStringField;
    adsMasterEditCheckTime: TDateTimeField;
    adsMasterEditWriter: TStringField;
    adsMasterEditWriteTime: TDateTimeField;
    adsMasterEditModifier: TStringField;
    adsMasterEditModifyTime: TDateTimeField;
    adsMasterEditRemark: TStringField;
    adsMasterStockName: TStringField;
    adsMasterConAreaName: TStringField;
    adsMasterBillTypeName: TStringField;
    adsMasterEditres_StockName: TStringField;
    adsMasterEditres_ConAreaName: TStringField;
    adsMasterEditres_BillTypeName: TStringField;
    adsMasterEditHelperCode: TStringField;
    adsMasterHelperCode: TStringField;
    adsInOutStockType: TADODataSet;
    adsMasterEditHasTune: TBooleanField;
    adsMasterHasTune: TBooleanField;
    adsMasterEditHasRefuel: TBooleanField;
    adsMasterEditBillcategory: TStringField;
    adsMasterBillcategory: TStringField;
    res_xt_InOutType: TADODataSet;
    adsMasterEditInOutType: TStringField;
    adsMasterEditHasBack: TBooleanField;
    adsMasterEditres_InOutTypeName: TStringField;
    adsMasterHasRefuel: TBooleanField;
    adsMasterStockCode: TStringField;
    adsMasterInOutType: TStringField;
    adsMasterInOutTypeName: TStringField;
    adsMasterHasBack: TBooleanField;
    adsMasterEditSrcInOutType: TStringField;
    res_SrcInOutType: TADODataSet;
    adsMasterEditres_SrcInOutTypeName: TStringField;
    adsMasterEditHasHand: TBooleanField;
    adsMasterEditHasSelfCom: TBooleanField;
    procedure adsMasterEditnameChange(Sender: TField);
  private
    { Private declarations }
  protected
    procedure ModuleInit; override;
  public
    { Public declarations }
    FType: string;
    procedure OpenEditDataSet; override;
  end;

var
  dtmda_InOutType: Tdtmda_InOutType;

implementation

uses uSQL;

{$R *.dfm}

{ Tdtmda_InOutType }

procedure Tdtmda_InOutType.ModuleInit;
begin
  FUniqueTable := 'da_InOutType';
  inherited;

end;

procedure Tdtmda_InOutType.OpenEditDataSet;
begin
  FMasterEditTable := 'da_InOutType';
  FMasterKeyField := 'ID';
  inherited;

end;

procedure Tdtmda_InOutType.adsMasterEditnameChange(Sender: TField);
begin
  inherited;
  if adsMasterEdit.State in [dsInsert, dsEdit] then
  begin
    adsMasterEdit.FieldByName('HelperCode').AsString := GetHzPy(Sender.AsString);
  end;
end;

end.
